import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { createPinia } from 'pinia';
import '@/assets/styles/index.css';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import * as icons from '@element-plus/icons';
import MyComponents from '@/components/index';

const app = createApp(App);
app.use(router);
app.use(createPinia());
app.use(ElementPlus, { size: 'default', locale: zhCn });
Object.keys(icons).forEach(key => {
  app.component(key, icons[key]);
});

import MyPD from './package/index.js';
import './package/theme/index.scss';
app.use(MyPD);

import VForm3 from 'vform3-builds'; //引入VForm3库
import 'vform3-builds/dist/designer.style.css'; //引入VForm3样式
app.use(VForm3); //全局注册VForm3(同时注册了v-form-designe、v-form-render等组件)

app.use(MyComponents);
app.mount('#app');

export default app;
